package com.shenmazong.dto;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * 软件表(例如boos直聘，智联招聘):闫瑞
 * @TableName tb_software
 */
@TableName(value ="tb_software")
@Data
@Document(indexName = "software_0923")
public class TbSoftware implements Serializable {
    /**
     * 软件id
     */
    @Id
    @TableId(value = "software_id",type = IdType.ASSIGN_ID)
    private Long softwareId;

    /**
     * 软件名称
     */
    @Field(type = FieldType.Text,analyzer = "ik_smart")
    private String softwareName;

    /**
     * 软件网站
     */
    private String softwareWeb;

    /**
     * 软件审核0未通过1通过
     */
    private Byte softwareAudit;

    /**
     * 创建时间
     */
    private String createTime;

    /**
     * 修改时间
     */
    private Date updateTime;

    /**
     * 物理删除0未删除1删除
     */
    @TableLogic
    private Byte deleteFlag;

    /**
     * 同步es0未同步1同步
     */
    private Byte syncEs;
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TbSoftware other = (TbSoftware) that;
        return (this.getSoftwareId() == null ? other.getSoftwareId() == null : this.getSoftwareId().equals(other.getSoftwareId()))
            && (this.getSoftwareName() == null ? other.getSoftwareName() == null : this.getSoftwareName().equals(other.getSoftwareName()))
            && (this.getSoftwareWeb() == null ? other.getSoftwareWeb() == null : this.getSoftwareWeb().equals(other.getSoftwareWeb()))
            && (this.getSoftwareAudit() == null ? other.getSoftwareAudit() == null : this.getSoftwareAudit().equals(other.getSoftwareAudit()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getDeleteFlag() == null ? other.getDeleteFlag() == null : this.getDeleteFlag().equals(other.getDeleteFlag()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getSoftwareId() == null) ? 0 : getSoftwareId().hashCode());
        result = prime * result + ((getSoftwareName() == null) ? 0 : getSoftwareName().hashCode());
        result = prime * result + ((getSoftwareWeb() == null) ? 0 : getSoftwareWeb().hashCode());
        result = prime * result + ((getSoftwareAudit() == null) ? 0 : getSoftwareAudit().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getDeleteFlag() == null) ? 0 : getDeleteFlag().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", softwareId=").append(softwareId);
        sb.append(", softwareName=").append(softwareName);
        sb.append(", softwareWeb=").append(softwareWeb);
        sb.append(", softwareAudit=").append(softwareAudit);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", deleteFlag=").append(deleteFlag);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}